Learn R Programming

tolBasis (version 1.0)

Ratio Arithmetic: Ratio Arithmetic Operators

Description

Arithmetic Operators for the "Ratio" class.

Usage

"+"(r1,r2) "-"(r1,r2) "*"(r1,r2) "/"(r1,r2) "^"(r,n)

Arguments

r1, r2, r
Ratio objects
n
a positive integer number

Value

Returns the Ratio object resulting of the arithmetical operation.

Examples

Run this code
r1 <- Ratio(1, 1+B)
r2 <- Ratio(A-B, (A+B)^2)
r3 <- r1 - r2

Run the code above in your browser using DataLab